package com.uw.scenic.feigin.hystrix;


import com.uw.scenic.feigin.TestUserClient;
import com.uw.scenic.vo.R;
import com.uw.scenic.vo.SysUserVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 测试微服务熔断策略实现
 */
@Slf4j
@Component
public class TestUserClientHystrix implements TestUserClient {

    @Override
    public R<SysUserVO> getById() {
        SysUserVO sysUser=new SysUserVO();
        sysUser.setUsername("返回调用用户微服务失败的兜底数据");
        return R.success(sysUser);
    }

    @Override
    public  R<SysUserVO> getById2() {
        SysUserVO sysUser=new SysUserVO();
        sysUser.setUsername("返回调用用户微服务失败的兜底数据2");
        return R.success(sysUser);
    }

    @Override
    public SysUserVO getById3() {
        SysUserVO sysUser=new SysUserVO();
        sysUser.setUsername("返回调用用户微服务失败的兜底数据3");
        return sysUser;
    }

    @Override
    public SysUserVO getById4() {
        SysUserVO sysUser=new SysUserVO();
        sysUser.setUsername("发生了异常，返回了兜底数据");
        return sysUser;
    }
}
